package org.top10.entity;

import java.util.Date;
import java.util.Set;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
/*
*select * from CollectRecord where type=1 and webSite='xunlei' and collectDate=today
*result:records,caption用作标识这些记录，比如评价最高，上升最快等
*/
@Entity
public class CollectRecord {
	private int id;
	private WebSite website;    //站点名称
	private String caption;    //标题,排名名称
	private Date collectDate;  //采集日期
	private int type;  //这个排名的类型,电影,or 小说,其他
	private  WebSite site;//网站标识 
	
	private Set<Comments> comment; //评论
	public CollectRecord(){
		collectDate=new Date();
	}
	
	@OneToMany(mappedBy="collRecord",fetch=FetchType.LAZY)
	public Set<Comments> getComment() {
		return comment;
	}
	public void setComment(Set<Comments> comment) {
		this.comment = comment;
	}
	
	
	@Id
    @GeneratedValue (strategy=GenerationType.AUTO)
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getCaption() {
		return caption;
	}
	public void setCaption(String caption) {
		this.caption = caption;
	}
	public Date getCollectDate() {
		return collectDate;
	}
	public void setCollectDate(Date collectDate) {
		this.collectDate = collectDate;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	public WebSite getSite() {
		return site;
	}

	public void setSite(WebSite site) {
		this.site = site;
	}

	public WebSite getWebsite() {
		return website;
	}

	public void setWebsite(WebSite website) {
		this.website = website;
	}
}
